<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace='Inventory' xmlns='http://ibatis.apache.org/mapping' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <alias>
    <typeAlias alias='Inventory' assembly='Janus.Mes.POCO.dll' type='Janus.Mes.POCO.Inventory' />
  </alias>
  <resultMaps>
    <resultMap id='InventoryResult' class='Inventory'>
	<result property='Id' column='Id' /> 
	<result property='InvCode' column='InvCode' /> 
	<result property='InvCName' column='InvCName' /> 
	<result property='InvStd' column='InvStd' /> 
	<result property='InvEName' column='InvEName' /> 
	<result property='InvCStd' column='InvCStd' /> 
	<result property='InvUnit' column='InvUnit' /> 
	<result property='UnitName' column='UnitName' /> 
	<result property='SafeQty' column='SafeQty' /> 
	<result property='CreatedDate' column='CreatedDate' /> 
	<result property='ExpirationDate' column='ExpirationDate' /> 
	<result property='UnitWeight' column='UnitWeight' /> 
	<result property='WhCode' column='WhCode' /> 
	<result property='WhLoc' column='WhLoc' /> 
	<result property='LeadTime' column='LeadTime' /> 
	<result property='ABC' column='ABC' /> 
	<result property='ProductCat' column='ProductCat' /> 
	<result property='MatCat' column='MatCat' /> 
	<result property='ConvertUnit' column='ConvertUnit' /> 
	<result property='ConvertRate' column='ConvertRate' /> 
	<result property='Creator' column='Creator' /> 
	<result property='CreateDate' column='CreateDate' /> 
	<result property='Updater' column='Updater' /> 
	<result property='UpdateDate' column='UpdateDate' /> 
	<result property='IsDelete' column='IsDelete' /> 
	<result property='CreatorCode' column='CreatorCode' /> 
	<result property='UpdaterCode' column='UpdaterCode' /> 
	<result property='UnitCode' column='UnitCode' /> 
	<result property='Invalid' column='Invalid' /> 
	<result property='OperDept' column='OperDept' /> 
	<result property='Timestamp' column='Timestamp' /> 
		</resultMap>
  </resultMaps>  
  <statements>
  <sql id="UpdaterConditions">  
  <dynamic prepend="SET">
        	<isPropertyAvailable prepend="" property="InvCName">
        <isNotEmpty prepend="," property="InvCName">
		          [InvCName]=#InvCName#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="InvStd">
        <isNotEmpty prepend="," property="InvStd">
		          [InvStd]=#InvStd#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="InvEName">
        <isNotEmpty prepend="," property="InvEName">
		          [InvEName]=#InvEName#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="InvCStd">
        <isNotEmpty prepend="," property="InvCStd">
		          [InvCStd]=#InvCStd#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="InvUnit">
        <isNotEmpty prepend="," property="InvUnit">
		          [InvUnit]=#InvUnit#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UnitName">
        <isNotEmpty prepend="," property="UnitName">
		          [UnitName]=#UnitName#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="SafeQty">
        <isNotEmpty prepend="" property="SafeQty">
				  <isNotEqual prepend="," property="SafeQty" compareValue="0">
		          [SafeQty]=#SafeQty#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreatedDate">
        <isNotEmpty prepend="" property="CreatedDate">
				  <isNotEqual prepend="," property="CreatedDate" compareValue="1900-01-01">
		          [CreatedDate]=#CreatedDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ExpirationDate">
        <isNotEmpty prepend="" property="ExpirationDate">
				  <isNotEqual prepend="," property="ExpirationDate" compareValue="1900-01-01">
		          [ExpirationDate]=#ExpirationDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UnitWeight">
        <isNotEmpty prepend="" property="UnitWeight">
				  <isNotEqual prepend="," property="UnitWeight" compareValue="0">
		          [UnitWeight]=#UnitWeight#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="WhCode">
        <isNotEmpty prepend="," property="WhCode">
		          [WhCode]=#WhCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="WhLoc">
        <isNotEmpty prepend="," property="WhLoc">
		          [WhLoc]=#WhLoc#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="LeadTime">
        <isNotEmpty prepend="" property="LeadTime">
				  <isNotEqual prepend="," property="LeadTime" compareValue="0">
		          [LeadTime]=#LeadTime#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ABC">
        <isNotEmpty prepend="," property="ABC">
		          [ABC]=#ABC#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ProductCat">
        <isNotEmpty prepend="," property="ProductCat">
		          [ProductCat]=#ProductCat#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="MatCat">
        <isNotEmpty prepend="," property="MatCat">
		          [MatCat]=#MatCat#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ConvertUnit">
        <isNotEmpty prepend="," property="ConvertUnit">
		          [ConvertUnit]=#ConvertUnit#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="ConvertRate">
        <isNotEmpty prepend="" property="ConvertRate">
				  <isNotEqual prepend="," property="ConvertRate" compareValue="0">
		          [ConvertRate]=#ConvertRate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="," property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="," property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="" property="IsDelete">
				  <isNotEqual prepend="," property="IsDelete" compareValue="0">
		          [IsDelete]=#IsDelete#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="UnitCode">
        <isNotEmpty prepend="," property="UnitCode">
		          [UnitCode]=#UnitCode#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="Invalid">
        <isNotEmpty prepend="," property="Invalid">
		          [Invalid]=#Invalid#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	<isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">
		          [OperDept]=#OperDept#
		          </isNotEmpty>
      </isPropertyAvailable>	
	    	 </dynamic>
    </sql>
	<sql id="WhereConditions">
	 <dynamic prepend="WHERE">
	 	 <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="AND" property="Id">
		          [Id]=#Id#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="InvCode">
        <isNotEmpty prepend="AND" property="InvCode">
		          [InvCode]=#InvCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="InvCName">
        <isNotEmpty prepend="AND" property="InvCName">
		          [InvCName]=#InvCName#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="InvStd">
        <isNotEmpty prepend="AND" property="InvStd">
		          [InvStd]=#InvStd#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="InvEName">
        <isNotEmpty prepend="AND" property="InvEName">
		          [InvEName]=#InvEName#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="InvCStd">
        <isNotEmpty prepend="AND" property="InvCStd">
		          [InvCStd]=#InvCStd#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="InvUnit">
        <isNotEmpty prepend="AND" property="InvUnit">
		          [InvUnit]=#InvUnit#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UnitName">
        <isNotEmpty prepend="AND" property="UnitName">
		          [UnitName]=#UnitName#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="SafeQty">
        <isNotEmpty prepend="" property="SafeQty">
				  <isNotEqual prepend="AND" property="SafeQty" compareValue="0">
		          [SafeQty]=#SafeQty#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreatedDate">
        <isNotEmpty prepend="" property="CreatedDate">
				  <isNotEqual prepend="AND" property="CreatedDate" compareValue="1900-01-01">
		          [CreatedDate]=#CreatedDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ExpirationDate">
        <isNotEmpty prepend="" property="ExpirationDate">
				  <isNotEqual prepend="AND" property="ExpirationDate" compareValue="1900-01-01">
		          [ExpirationDate]=#ExpirationDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UnitWeight">
        <isNotEmpty prepend="" property="UnitWeight">
				  <isNotEqual prepend="AND" property="UnitWeight" compareValue="0">
		          [UnitWeight]=#UnitWeight#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="WhCode">
        <isNotEmpty prepend="AND" property="WhCode">
		          [WhCode]=#WhCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="WhLoc">
        <isNotEmpty prepend="AND" property="WhLoc">
		          [WhLoc]=#WhLoc#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="LeadTime">
        <isNotEmpty prepend="" property="LeadTime">
				  <isNotEqual prepend="AND" property="LeadTime" compareValue="0">
		          [LeadTime]=#LeadTime#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ABC">
        <isNotEmpty prepend="AND" property="ABC">
		          [ABC]=#ABC#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ProductCat">
        <isNotEmpty prepend="AND" property="ProductCat">
		          [ProductCat]=#ProductCat#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="MatCat">
        <isNotEmpty prepend="AND" property="MatCat">
		          [MatCat]=#MatCat#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ConvertUnit">
        <isNotEmpty prepend="AND" property="ConvertUnit">
		          [ConvertUnit]=#ConvertUnit#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="ConvertRate">
        <isNotEmpty prepend="" property="ConvertRate">
				  <isNotEqual prepend="AND" property="ConvertRate" compareValue="0">
		          [ConvertRate]=#ConvertRate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="AND" property="Creator">
		          [Creator]=#Creator#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="" property="CreateDate">
				  <isNotEqual prepend="AND" property="CreateDate" compareValue="1900-01-01">
		          [CreateDate]=#CreateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="AND" property="Updater">
		          [Updater]=#Updater#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="" property="UpdateDate">
				  <isNotEqual prepend="AND" property="UpdateDate" compareValue="1900-01-01">
		          [UpdateDate]=#UpdateDate#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="" property="IsDelete">
				  <isNotEqual prepend="AND" property="IsDelete" compareValue="0">
		          [IsDelete]=#IsDelete#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="AND" property="CreatorCode">
		          [CreatorCode]=#CreatorCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="AND" property="UpdaterCode">
		          [UpdaterCode]=#UpdaterCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="UnitCode">
        <isNotEmpty prepend="AND" property="UnitCode">
		          [UnitCode]=#UnitCode#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Invalid">
        <isNotEmpty prepend="AND" property="Invalid">
		          [Invalid]=#Invalid#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="AND" property="OperDept">
		          [OperDept]=#OperDept#
		          </isNotEmpty>
      </isPropertyAvailable>
	  	 <isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="" property="Timestamp">
				  <isNotEqual prepend="AND" property="Timestamp" compareValue="1900-01-01">
		          [Timestamp]=#Timestamp#
		  		  </isNotEqual>
		        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic> 
    </sql>
	<sql id="InsertPublic">
      INSERT INTO Inventory(
	     <dynamic prepend=" ">
       	   <isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">
          [Id]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="InvCode">
        <isNotEmpty prepend="," property="InvCode">
          [InvCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="InvCName">
        <isNotEmpty prepend="," property="InvCName">
          [InvCName]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="InvStd">
        <isNotEmpty prepend="," property="InvStd">
          [InvStd]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="InvEName">
        <isNotEmpty prepend="," property="InvEName">
          [InvEName]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="InvCStd">
        <isNotEmpty prepend="," property="InvCStd">
          [InvCStd]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="InvUnit">
        <isNotEmpty prepend="," property="InvUnit">
          [InvUnit]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UnitName">
        <isNotEmpty prepend="," property="UnitName">
          [UnitName]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="SafeQty">
        <isNotEmpty prepend="," property="SafeQty">
          [SafeQty]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreatedDate">
        <isNotEmpty prepend="," property="CreatedDate">
          [CreatedDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ExpirationDate">
        <isNotEmpty prepend="," property="ExpirationDate">
          [ExpirationDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UnitWeight">
        <isNotEmpty prepend="," property="UnitWeight">
          [UnitWeight]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="WhCode">
        <isNotEmpty prepend="," property="WhCode">
          [WhCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="WhLoc">
        <isNotEmpty prepend="," property="WhLoc">
          [WhLoc]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="LeadTime">
        <isNotEmpty prepend="," property="LeadTime">
          [LeadTime]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ABC">
        <isNotEmpty prepend="," property="ABC">
          [ABC]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ProductCat">
        <isNotEmpty prepend="," property="ProductCat">
          [ProductCat]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="MatCat">
        <isNotEmpty prepend="," property="MatCat">
          [MatCat]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ConvertUnit">
        <isNotEmpty prepend="," property="ConvertUnit">
          [ConvertUnit]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="ConvertRate">
        <isNotEmpty prepend="," property="ConvertRate">
          [ConvertRate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">
          [Creator]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">
          [CreateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">
          [Updater]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">
          [UpdateDate]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="," property="IsDelete">
          [IsDelete]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">
          [CreatorCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">
          [UpdaterCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="UnitCode">
        <isNotEmpty prepend="," property="UnitCode">
          [UnitCode]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Invalid">
        <isNotEmpty prepend="," property="Invalid">
          [Invalid]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">
          [OperDept]
        </isNotEmpty>
      </isPropertyAvailable>
	  	   <isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="," property="Timestamp">
          [Timestamp]
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
      VALUES
      (
	   <dynamic prepend=" ">
      	<isPropertyAvailable prepend="" property="Id">
        <isNotEmpty prepend="," property="Id">		
         #Id#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="InvCode">
        <isNotEmpty prepend="," property="InvCode">		
         #InvCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="InvCName">
        <isNotEmpty prepend="," property="InvCName">		
         #InvCName#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="InvStd">
        <isNotEmpty prepend="," property="InvStd">		
         #InvStd#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="InvEName">
        <isNotEmpty prepend="," property="InvEName">		
         #InvEName#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="InvCStd">
        <isNotEmpty prepend="," property="InvCStd">		
         #InvCStd#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="InvUnit">
        <isNotEmpty prepend="," property="InvUnit">		
         #InvUnit#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UnitName">
        <isNotEmpty prepend="," property="UnitName">		
         #UnitName#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="SafeQty">
        <isNotEmpty prepend="," property="SafeQty">		
         #SafeQty#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreatedDate">
        <isNotEmpty prepend="," property="CreatedDate">		
         #CreatedDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ExpirationDate">
        <isNotEmpty prepend="," property="ExpirationDate">		
         #ExpirationDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UnitWeight">
        <isNotEmpty prepend="," property="UnitWeight">		
         #UnitWeight#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="WhCode">
        <isNotEmpty prepend="," property="WhCode">		
         #WhCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="WhLoc">
        <isNotEmpty prepend="," property="WhLoc">		
         #WhLoc#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="LeadTime">
        <isNotEmpty prepend="," property="LeadTime">		
         #LeadTime#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ABC">
        <isNotEmpty prepend="," property="ABC">		
         #ABC#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ProductCat">
        <isNotEmpty prepend="," property="ProductCat">		
         #ProductCat#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="MatCat">
        <isNotEmpty prepend="," property="MatCat">		
         #MatCat#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ConvertUnit">
        <isNotEmpty prepend="," property="ConvertUnit">		
         #ConvertUnit#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="ConvertRate">
        <isNotEmpty prepend="," property="ConvertRate">		
         #ConvertRate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Creator">
        <isNotEmpty prepend="," property="Creator">		
         #Creator#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreateDate">
        <isNotEmpty prepend="," property="CreateDate">		
         #CreateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Updater">
        <isNotEmpty prepend="," property="Updater">		
         #Updater#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdateDate">
        <isNotEmpty prepend="," property="UpdateDate">		
         #UpdateDate#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="IsDelete">
        <isNotEmpty prepend="," property="IsDelete">		
         #IsDelete#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="CreatorCode">
        <isNotEmpty prepend="," property="CreatorCode">		
         #CreatorCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UpdaterCode">
        <isNotEmpty prepend="," property="UpdaterCode">		
         #UpdaterCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="UnitCode">
        <isNotEmpty prepend="," property="UnitCode">		
         #UnitCode#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Invalid">
        <isNotEmpty prepend="," property="Invalid">		
         #Invalid#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="OperDept">
        <isNotEmpty prepend="," property="OperDept">		
         #OperDept#		
        </isNotEmpty>
      </isPropertyAvailable>
	  	<isPropertyAvailable prepend="" property="Timestamp">
        <isNotEmpty prepend="," property="Timestamp">		
         #Timestamp#		
        </isNotEmpty>
      </isPropertyAvailable>
	  </dynamic>
      )
    </sql>
	<!-- Insert statement:新增Mapper-->
    <insert id='Insert' parameterClass='Inventory'>
      <include refid="InsertPublic"/>
    </insert>
    <!--Update statement:修改Mapper-->
    <update id='Update' parameterClass='Inventory'>
      UPDATE [Inventory] 
      <include refid="UpdaterConditions"/>
      WHERE 1=1
	  	  AND InvCode=#InvCode#
	      </update>
    <update id='UpdateSetion' parameterClass='hashtable'>
      UPDATE [Inventory] 
      <include refid="UpdaterConditions"/>
      WHERE $conditions$
    </update>
	<update id='Save' parameterClass='Inventory'>
      IF NOT EXISTS(SELECT 1 FROM [Inventory] WHERE 1=1  AND [InvCode]=#InvCode# )
      BEGIN
      <include refid="InsertPublic"/>
      END
      ELSE
      BEGIN
      UPDATE Inventory 
      <include refid="UpdaterConditions"/>
      WHERE  1=1
	  	  AND [InvCode]=#InvCode#
	        END
    </update>
	<delete id='Delete' parameterClass='hashtable'>
      DELETE FROM [Inventory] WHERE	  
        <![CDATA[  
	 [InvCode]=#pk0# 
        ]]>
    </delete>
    <delete id='DeleteWhere' parameterClass='string'>
      DELETE FROM [Inventory] WHERE $value$
    </delete>

    <!-- select by key statement:-->
    <select id='FindOne' parameterClass='hashtable' resultClass='Inventory'>
      SELECT * FROM Inventory WHERE      
        <![CDATA[
		[InvCode]=#pk0# 
        ]]>
    </select>
    <select id='FindAllCondition' parameterClass='string' resultClass='Inventory'>
      SELECT * FROM [Inventory] WHERE $value$
    </select>
    <select id='FindScalar' parameterClass='hashtable' resultClass='Inventory'>
      SELECT * FROM [Inventory] WHERE $conditions$
    </select>
    
    <select id='FindAllCount' parameterClass='string' resultClass='int'>
      SELECT COUNT(1) FROM [Inventory] WHERE $value$
    </select>
    <select id='FindByPage' parameterClass='string' resultClass='Inventory'>
      SELECT * FROM [Inventory] WHERE $value$
    </select>
  </statements>
</sqlMap>
